from selenium.webdriver.common.by import By

from ecshop.base.base import Base, logger
from ecshop.utils.Config import Config
from ecshop.utils.Logger import Logger

logger = Logger('BaiduHomePage').getlog()

class BaiduHomePage(Base):
    file = '../config/config.ini'  # 文件路径为自己的包路径
    config = Config(file)

    def __init__(self,driver):
        Base.__init__(self,driver)

    def input_usename_text(self):
        self.input((By.NAME,'username'),'caichang')
        logger.info()


    def input_password(self):
        self.input((By.NAME,'password'),'caichang1')

    def click_search_button(self):
        self.click((By.ID,'tijiao'))

    def into_frame_goods(self):
        self.into_frame('menu-frame')
    def click_goods(self):
        self.click((By.XPATH,'//*[@id="menu-ul"]/li[2]/ul/li[1]/a'))






# class BaiduHomePage(Base):
#     def __init__(self, driver):
#         Base.__init__(self,driver)
#
#     def input_search_text(self):
#         self.input((By.ID,'kw'),'布兰妮')
#
#     def click_search_button(self):
#         self.click((By.ID,'su'))